package aone

import "time"

type CodeReviewSetting struct {
	AllowSelfApproval          bool          `json:"allow_self_approval"`
	DefaultReviewers           []Author      `json:"default_reviewers"`
	DefaultSubscribers         []Author      `json:"default_subscribers"`
	EmailGroups                string        `json:"email_groups"`
	EnableCodeOwnerFocusMode   bool          `json:"enable_code_owner_focus_mode"`
	MergeTypes                 []string      `json:"merge_types"`
	MinimunApproval            int64         `json:"minimun_approval"`
	RequireCodeOwnerCheck      bool          `json:"require_code_owner_check"`
	RequireDiscussionProcessed bool          `json:"require_discussion_processed"`
	RequireP3CCheck            bool          `json:"require_p3c_check"`
	ResetApprovalWhenNewPush   bool          `json:"reset_approval_when_new_push"`
	Tests                      []interface{} `json:"tests"`
}

type ProtectBranch struct {
	AllowForcePush      bool      `json:"allow_force_push"`
	CommittedAt         time.Time `json:"committed_at"`
	DevelopersCanAccept bool      `json:"developers_can_accept"`
	DevelopersCanMerge  bool      `json:"developers_can_merge"`
	DevelopersCanPush   bool      `json:"developers_can_push"`
	ID                  string    `json:"id"`
	Name                string    `json:"name"`
	ShortID             string    `json:"short_id"`
	WhoCanMerge         string    `json:"who_can_merge"`
	WhoCanPush          string    `json:"who_can_push"`
}

type PushRule struct {
	BranchName string    `json:"branch_name"`
	ID         int64     `json:"id"`
	IsEnabled  bool      `json:"is_enabled"`
	Name       string    `json:"name"`
	RuleInfo   string    `json:"rule_info"`
	UpdatedAt  time.Time `json:"updatedAt"`
	UpdatedBy  Author    `json:"updatedBy"`
}

type ProjectPushRule struct {
	CheckerName       string      `json:"checker_name"`
	CheckerType       interface{} `json:"checker_type"`
	ExtraMessage      string      `json:"extra_message"`
	IsOpened          bool        `json:"is_opened"`
	ThirdPartyTimeout interface{} `json:"third_party_timeout"`
	ThirdPartyURL     interface{} `json:"third_party_url"`
}

type WebHook struct {
	BuildEvents           bool      `json:"build_events"`
	CreatedAt             time.Time `json:"created_at"`
	EnableSslVerification bool      `json:"enable_ssl_verification"`
	ID                    int64     `json:"id"`
	IssuesEvents          bool      `json:"issues_events"`
	MergeRequestsEvents   bool      `json:"merge_requests_events"`
	NoteEvents            bool      `json:"note_events"`
	ProjectID             int64     `json:"project_id"`
	PushEvents            bool      `json:"push_events"`
	TagPushEvents         bool      `json:"tag_push_events"`
	URL                   string    `json:"url"`
}

type DeployKey struct {
	CreatedAt       time.Time  `json:"created_at"`
	Fingerprint64   string     `json:"fingerprint"`
	ID              int64      `json:"id"`
	Projects        []Projects `json:"projects"`
	PublicDeployKey bool       `json:"publicDeployKey"`
	Title           string     `json:"title"`
}

type Projects struct {
	ID                int64  `json:"id"`
	Name              string `json:"name"`
	NameWithNamespace string `json:"name_with_namespace"`
	Path              string `json:"path"`
	PathWithNamespace string `json:"path_with_namespace"`
}

type ErrorMsg struct {
	ErrorCode string `json:"errorCode"`
	Message   string `json:"message"`
	Status    bool   `json:"status"`
	TraceID   string `json:"traceId"`
}
